DIR=../../SPOOLES

CFLAGS = -Wall -O3  -I $(DIR) -I ../../pthreads-w32-2-9-1-release/Pre-built.2/include -DARCH="Linux" -DSPOOLES -DARPACK -DMATRIXSTORAGE -D_SC_NPROCESSORS_CONF=1 -posix
FFLAGS = -Wall -O3 -fopenmp

CC=gcc
FC=gfortran

.c.o :
	$(CC) $(CFLAGS) -c $<
.f.o :
	$(FC) $(FFLAGS) -c $<

include Makefile.inc

SCCXMAIN = ccx_2.10.c

OCCXF = $(SCCXF:.f=.o)
OCCXC = $(SCCXC:.c=.o)
OCCXMAIN = $(SCCXMAIN:.c=.o)


LIBS = \
       $(DIR)/spooles.a \
	../../ARPACK/libarpack_MINGW64.a \
       ../../pthreads-w32-2-9-1-release/Pre-built.2/lib/$(ARCH)/libpthreadGC2.a -lm

ccx_2.10: $(OCCXMAIN) ccx_2.10.a
	./date.pl; $(CC) $(CFLAGS) -c ccx_2.10.c; $(FC) -fopenmp -Wall -O3 -o $@ $(OCCXMAIN) ccx_2.10.a $(LIBS)

ccx_2.10.a: $(OCCXF) $(OCCXC)
	ar vr $@ $?
                                                                               
